﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data;
using VanTaiProperty;
namespace VanTaiData
{
    public class TMMAIL_CONFIG_Controller : clsConnect
    {
        private clsConnect cls = new clsConnect();
        #region[Get-Data]
        public DataTable BindGridMail()
        {
            return cls.BindGridData("sp_MAIL_CONFIG");
        }
        public DataTable BindGridMailDetail_Edit(int id)
        {
            return cls.LayDuLieuParameter("sp_MailConfig_Edit", "@IDMAIL", id);
        }
        #endregion

        #region[Update]
        public bool UpdateMailConfig(clsMAIL_CONFIGProperty data)
        {
            cls.CreateNewSqlCommand();
            cls.AddParameter("@IDMAIL", data.IDMAIL);
            cls.AddParameter("@TITILEMAIL", data.TITILEMAIL);
            cls.AddParameter("@CONTENTMAIL", data.CONTENTMAIL);
            cls.AddParameter("@LINKACTIVE", data.LINKACTIVE);
            cls.AddParameter("@LINKACTIVE1", data.LINKACTIVE1);
            cls.AddParameter("@USERNAME", data.USERNAME);
            cls.AddParameter("@PASSWORDS", data.PASSWORDS);
            cls.ExecuteNonQuery("sp_UpdateMail_Config");
            return true;
        }
        #endregion
    }
}
